home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-09-18 | 20.4 KB | 636 lines | [TEXT/MPS ] |
- !
- ! US Robotics Courier HST 9600 baud CCL script (Hardware MNP)
- !
- ! Change History-
- ! v1.0.2 1/15/91 gs:Created CCL
- !
- ! The following label ranges (0-255) are defined for all scripts:
- !
- ! Label Function
- ! ----- --------
- ! 0-19 Communications Setup
- ! 20-39 Get a Modem (IBX switch thru)
- ! 40-59 Modem Setup
- ! 60-79 Dialing
- ! 80-99 Physical Connection
- ! 100-119 GEIS Logon
- ! 120-139 CICS
- ! 140-159 APPM
- ! 160-179 Online
- ! 180-199 Terminate Session
- ! 200-209 Cancel
- ! 210-219 Hangup
- ! 230-239 <UNUSED>
- ! 240-255 Disconnect
- !
- ! Note: Label 210 is the modem hangup sequence
- ! Label 240 is reserved as the start of the disconnect sequence
- !
- !================================================================================
- -LABEL 0 !***<Physical connection entry point>*** Initialize Communications
- !================================================================================
- !
- ! Set the Baud, Data, Stop, and Parity bits
- SerReset ~Baud ~Prty ~Xbts ~Sbts
- CTBParameter Port "~MPrt" 13
- !
- ! CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
- CTBOpen 14 15 ! Open the Communications session
- !
- ! Flush any data, Initialize script variables and define Cancel label
- Flush ! clear input buffer and ring buffer
- CanBtn 200 ! If user cancels, take the error return
- !
- SetVar 1 0 ! #of consecutive no responses to hangup command
- SetVar 2 0 ! #of consecutive no responses to modem configuration command
- SetVar 3 0 ! #of consecutive network contact failures.
- SetVar 4 0 ! #of logon validation failures
- SetVar 5 0 ! #of consecutive CICS90 failures
- SetVar 6 0 ! #of consecutive APPM failures
- SetVar 7 0 ! flag to indicate if connecting(0) or disconnecting(1)
- SetVar 8 0 ! not used
- !
- Jump 20 ! Go to Modem Selection and Setup
- !
- !*********
- -LABEL 13 !---<CTBParameter Port failed>---
- !*********
- Alert -1 CTBParameter Port caused an error.
- Exit -1 ! exit the script with an error.
- !
- !*********
- -LABEL 14 !---<CTBOpen failed>---
- !*********
- Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
- Exit -1 ! exit the script with an error.
- !
- !**********
- -LABEL 15 !---<CTBOpen err>---
- !**********
- Alert -1 CTBOpen caused an Communications Toolbox error.
- Exit -1 ! exit the script with an error.
- !
- !================================================================================
- -LABEL 20 !***<Modem Selection>*** Select modem through IBX switch
- !================================================================================
- !
- !================================================================================
- -LABEL 40 !***<Modem Setup>*** Modem Reset and Setup
- !================================================================================
- DsplyPic 1
- DsplyMsg Making sure the modem is ready.
- Jsr 210 ! Hang up (just in case)
- SetVar 1 0 ! clear # hangup tries counter
- !
- !**********
- -LABEL 42 ! ---<Got modem attention>---
- !**********
- DsplyMsg Setting modem parameters.
- ! Clear all previous MatchStr's and setup the modem
- MatchStr 1 42 Dummy
- Wait 30 ! Give modem .5 second to get ready before sending the attention chars
- ! Send US Robotics Courier HST MNP Compatible modem commands
- ! V1 = verbose, &i2 = Xon/Xoff, &H2 = use s/w flow control,
- ! &A3 = return extended result codes, X6 = get all result codes
- Xmit ATV1&i2&H2&M5&A3X6
- Wait 3
- Flush ! clear input buffer and send Carriage Return (CR)
- Xmit \13
- !
- ! Look for one of the following expected responses
- MatchStr 1 60 OK
- Wait 180 ! wait 3 secs
- IncVar 2 ! increment # modem setup tries
- IfVar 2 3 44 ! if 3 tries, display Modem Configuration Alert
- DsplyMsg Modem does not respond to setup commands. Retrying ...
- Jump 42 ! else try modem setup again
- !
- !**********
- -LABEL 44 ! ---<Modem configuration err>---
- !**********
- Bell
- Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
- SetVar 2 0 ! clear # modem setup tries
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 60 !***<Modem ready>*** Dial phone
- !================================================================================
- DsplyMsg Dialing ~Fone ...
- DsplyPic 2
- ! Clear all previous MatchStr's (No comments on same line as MatchStr's)
- MatchStr 1 60 Dummy
- SetVar 2 0 ! clear #modem setup tries
- ! Turn off Xon/Xoff flow control
- CTBParameter Handshake XON/XOFF 78
- Wait 30 ! Give modem .5 secs to get ready before sending the attention chars
- Xmit AT
- Wait 3 ! Pause before "tone dial" command
- Xmit D~Tone
- Wait 3 ! Pause before phone number
- Xmit ~Fone
- Wait 3
- Flush ! clear input buffer and send CR
- Xmit \13
- !
- ! Look for one of the following expected responses
- MatchStr 1 80 MNP\13
- MatchStr 2 66 CARRIER
- MatchStr 3 70 BUSY
- MatchStr 4 74 NO DIAL
- MatchStr 5 62 ERROR
- Wait 2100 ! wait 35 secs
- !
- !**********
- -LABEL 62 !---<No response or ERROR from modem>---
- !**********
- IncVar 3 ! Increment # dial attempts counter
- IfVar 3 4 64 ! if 4 attempts, display No Dial Response Alert
- DsplyMsg Modem does not respond to Dial command. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 64 !---<No dial response err>---
- !**********
- Bell
- Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 66 !---<No Carrier>---
- !**********
- IncVar 3 ! Increment # dial attempts counter
- IfVar 3 4 68 ! if 4 attempts, display No Carrier Alert
- DsplyMsg No Carrier with phone number dialed. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 68 !---<No carrier err>---
- !**********
- Bell
- Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 70 !---<busy>---
- !**********
- IncVar 3 ! Increment # dial attempts counter
- IfVar 3 4 72 ! if 4 attempts, display Busy Alert
- DsplyMsg Phone number dialed is busy. Pause before retrying.
- Wait 300 ! wait 5 secs
- DsplyMsg Phone number dialed is busy. Retrying ....
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 72 !---<Busy err>---
- !**********
- Bell
- Alert 200 All network access lines are in use.\13Try again later.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 74 !---<No Dialtone>---
- !**********
- IncVar 3 ! Increment # dial attempts counter
- IfVar 3 4 76 ! if 4 attempts, display No Dialtone Alert
- DsplyMsg Modem reports no dial tone. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 76 !---<No dialtone Error>---
- !**********
- Bell
- Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 78 !---<CTBParameter XON/XOFF failed>---
- !*********
- Alert -1 CTBParameter XON/XOFF caused an error.
- Exit -1 ! exit the script with an error
- !
- !================================================================================
- -LABEL 80 !***<Establish Physical Connection>*** Send H's to identify us to network
- !================================================================================
- DsplyMsg Requesting network attention
- ! Look for one of the following expected responses
- MatchStr 1 84 NO CARRIER
- MatchStr 2 100 U#
- Wait 12 ! Wait 0.2 sec before sending the first H
- Xmit H
- Wait 21 ! Wait another 0.35 sec before sending the second H
- Xmit H
- Wait 600 ! Allow 10 seconds for the U# to show up
- IncVar 3 ! No U#, increment # dial attempts counter
- IfVar 3 4 82 ! if 4 attempts, display No U# Alert
- DsplyMsg Unable to get network attention. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 82 !---<No U#>---
- !**********
- Bell
- Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 84 !---<Line dropped>---
- !**********
- IncVar 3 ! Increment # dial attempts counter
- IfVar 3 4 86 ! if 4 attempts, display Line Dropped Alert
- DsplyMsg Carrier signal dropped before network recognition. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !**********
- -LABEL 86 !---<Line dropped Err>---
- !**********
- Bell
- Alert 200 Carrier signal dropped before network recognition.\13Try again.
- SetVar 3 0 ! clear # dial attempts counter
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 100 !***<GEIS logon>***
- !================================================================================
- !
- DsplyMsg Physical Connection established. Logging on to network ...
- DsplyPic 3
- SetVar 3 0 ! clear # dial attempts counter
- Wait 6 ! wait 0.1 sec
- Flush ! clear input buffer
- ! Note: leave 2 spaces between ~Dist and ~Numb
- Xmit ~User,~Dist ~Numb,~Ridn\13
- !
- ! Look for one of the following expected responses
- MatchStr 1 104 NO CARRIER
- MatchStr 2 106 DISCONNECTED
- MatchStr 3 120 ===>
- MatchStr 6 108 N FAULT,
- MatchStr 7 108 T FORMAT,
- MatchStr 8 110 L DENIED
- MatchStr 9 112 BUSY
- MatchStr 10 112 DOWN
- Wait 4200 ! wait up to 70 seconds for a response
- IncVar 4 ! Increment # logon attempts counter
- IfVar 4 3 102 ! if 3 tries, display No Login Response alert
- DsplyMsg No logon response from network. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 102 !---<No Logon response>---
- !*********
- Bell
- Alert 200 No logon response from network.\13Try again.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 104 !---<Carrier dropped>---
- !*********
- IncVar 4 ! Increment # login attempts counter
- IfVar 4 3 105 ! if 3 attempts, display Carrier dropped alert
- DsplyMsg Carrier signal dropped during network logon. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 105 !---<Carrier dropped Err>---
- !*********
- Bell
- Alert 200 Carrier signal dropped during network logon.\13Try again.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 106 !---<Session disconnected>---
- !*********
- IncVar 4 ! Increment # logon attempts counter
- IfVar 4 3 107 ! if 3 attempts, display Session disconnected alert
- DsplyMsg Network connection dropped during network logon. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 107 !---<Session disconnected Err>---
- !*********
- Bell
- Alert 200 Network connection dropped during network logon.\13Try again.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 108 !---<Validation fault>---
- !*********
- IncVar 4 ! Increment # logon attempts counter
- IfVar 4 3 109 ! see if limit of 3 is exceeded.
- DsplyMsg Network rejected your identification. Retrying ...
- Wait 60 ! wait 1 sec
- Jump 100 ! retry GEIS login (only case where we don't reset)
- !
- !*********
- -LABEL 109 !---<validation fault err>---
- !*********
- Bell
- Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 110 !---<Denied by host>---
- !*********
- IncVar 4 ! Increment # logon attempts counter
- IfVar 4 3 111 ! if 3 attempts, display Network Problem alert
- DsplyMsg Network host equipment problem detected. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 111 !---<Denied by host err>---
- !*********
- Bell
- Alert 200 Network host equipment problem detected.\13Try again.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 112 !---<MARK3K access busy/down>---
- !*********
- IncVar 4 ! Increment # logon attempts counter
- IfVar 4 3 113 ! if 3 attempts, display Network Busy alert
- DsplyMsg Network equipment busy/down. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 113 !---<MARK3K access busy/down err>---
- !*********
- Bell
- Alert 200 Network equipment busy or down.\13Try again.
- SetVar 4 0 ! clear # logon attempts counter
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 120 !***<MARK3000 prompt>*** Invoke CICS
- !================================================================================
- !
- DsplyMsg Requesting access to network subsystem ...
- DsplyPic 4
- Wait 6 ! wait 0.1 secs
- Flush ! clear input buffer
- !
- Xmit ~CICS\13
- ! Look for one of the following expected responses
- MatchStr 3 140 READY
- ! To overcome a network problem, the following label was changed from 124 to 126
- ! MatchStr 4 124 T BOUND
- MatchStr 4 126 T BOUND
- MatchStr 5 126 UNRECOGN
- MatchStr 6 126 ===>
- Wait 3600 ! Allow 60 secs for the expected responses to show up
- IncVar 5 ! Timeout, so increment # CICS tries counter
- IfVar 5 2 122 ! if 3 tries, display No Response alert
- DsplyMsg No response to network subsystem request. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 122 !---<No CICS err>---
- !*********
- Bell
- Alert 200 No response to network subsystem request.\13Try again.
- SetVar 5 0 ! clear # CICS tries counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 124 !---<Session not bound err>---
- !*********
- Bell
- Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
- Jump 200 ! jump to cancel routine
- !
- !*********
- -LABEL 126 !---<Invalid application>---
- !*********
- IncVar 5 ! Increment # CICS tries counter
- IfVar 5 3 127 ! if 3 tries, display Invalid Application alert
- DsplyMsg Network subsystem request has been rejected. Retrying ...
- Wait 60 ! wait 1 sec
- Flush
- Jump 120 ! try to access CICS again
- !
- !*********
- -LABEL 127 !---<Invalid application err>---
- !*********
- Bell
- Alert 200 The network subsystem request has been rejected.\13Try again.
- SetVar 5 0 ! clear # CICS tries counter
- Flush
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 140 !***<CICS ready>*** Start APPM transaction
- !================================================================================
- !
- DsplyMsg Requesting access to distribution center ~Dist ...
- DsplyPic 5 ! Highlight box 5 on screen
- SetVar 5 0 ! clear # CICS tries counter
- ! ! Send what needs to be sent
- Xmit ~Epgm~Dist\13
- ! Look for one of the following expected responses
- Wait 12 ! wait 0.2 secs
- Flush ! clear input buffer
- ! Look for one of the following expected responses
- MatchStr 3 160 C100
- MatchStr 4 144 INVALID
- Wait 3600 ! Allow 60 secs for the expected responses to show up
- !
- IncVar 6 ! Timeout, so Increment # APPM tries counter
- IfVar 6 2 142 ! if 2 tries, display No Transaction alert
- DsplyMsg No response to distribution center access request. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 142 !---<No transaction response>---
- !*********
- Bell
- Alert 200 No response to distribution center access.\13Try again.
- SetVar 6 0 ! reset # APPM tries counter
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 144 !---<Invalid transaction>---
- !*********
- IncVar 6 ! Increment # APPM tries counter
- IfVar 6 2 145 ! if 2 tries, display Invalid Transaction alert
- DsplyMsg Distribution center access request rejected. Retrying ...
- Jump 40 ! reset modem and try again
- !
- !*********
- -LABEL 145 !---<Invalid transaction err>---
- !*********
- Bell
- Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
- SetVar 6 0 ! reset # APPM tries counter
- Jump 40 ! reset modem and try again
- !
- !================================================================================
- -LABEL 160 !***<Online>***
- !================================================================================
- !
- Wait 60 ! wait 1 sec
- DsplyMsg Accessing the distribution center ~Dist ...
- DsplyPic 6 ! Highlight box 6 on screen
- ! C9 = pass msg thru GE, 899 = Echo cmd
- Xmit C9899Ole\13
- ! Look for one of the following expected responses
- MatchStr 2 162 C5
- MatchStr 3 170 Ole\13
- Wait 7200 ! wait 2 minutes for echo back or distribution center nonavail msg
- !
- !*********
- -LABEL 162 !---<no luck this time>---
- !*********
- DsplyMsg Distribution center is not available ...
- Jsr 180 ! terminate session
- Bell
- Alert -1 Distribution center is not available.\13Please try again later.
- Jump 200 ! exit to Cancel routine
- !
- !*********
- -LABEL 170 !---<Success, we’re in, so exit>---
- !*********
- Wait 30 ! wait 0.5 secs
- Flush ! clear input buffer
- Exit 0 ! exit the script normally
- !
- !================================================================================
- -LABEL 180-199 !***<Terminate Session>***
- !================================================================================
- !
- !*********
- -LABEL 180 !---<Terminate session>---
- !*********
- ! send Abnormal disconnect command
- Xmit C3\13
- ! Look for one of the following expected responses
- MatchStr 1 182 U#
- Wait 300 ! wait 5 secs
- Return
- !
- !*********
- -LABEL 182 !---<Say bye>---
- !*********
- Wait 6 ! wait 0.1 sec and sign off the network
- Xmit BYE\13
- Return
- !
- !================================================================================
- -LABEL 200 !***<Cancel Routine>***
- !================================================================================
- DsplyMsg Canceling ...
- Flush
- Wait 30 ! wait 0.5 secs
- Exit -1 ! exit the script with an error
- !
- !================================================================================
- -LABEL 210 !***<Hang up phone Routine>***
- !================================================================================
- !
- ! Look for one of the following expected responses
- MatchStr 1 222 CARRIER
- SetVar 1 0 ! clear # hangup tries counter
- SetVar 2 0 ! clear # modem config tries counter and reuse for MNPStatus checks
- !
- !*********
- -LABEL 220 !---<Hang up the phone subroutine>---
- !*********
- Wait 60 ! wait 1 sec (beginning guard time) and send +++ (escape)
- Xmit +
- Xmit +
- Xmit +
- Wait 60 ! wait 1 more sec (end guard time)
- Flush ! clear input buffer and tell modem to hang up verbosely
- Xmit ATV1H\13
- ! Look for one of the following expected responses
- MatchStr 2 222 OK
- MatchStr 3 224 ERROR
- Wait 120 ! wait 2 secs
- Jump 224 ! test for error or no response
- !
- !*********
- -LABEL 222 !---<Reset the modem>---
- !*********
- !
- IfVar 7 0 229 ! If NOT disconnecting, bypass the modem reset.
- ! This aids in script debugging so we dont reset modem 1st time.
- Flush ! Flush the buffer and send Hayes Reset Modem command
- Xmit ATZ\13
- ! Look for one of the following expected responses
- MatchStr 2 229 OK
- MatchStr 3 224 ERROR
- Wait 180 ! wait 3 secs
- !
- !*********
- -LABEL 224 !---<Error or just no response>---
- !*********
- IncVar 1 ! Increment # hangup tries counter
- IfVar 1 3 225 ! if 3 tries, display error alert and try again
- Jump 220 ! try to hangup again
- !
- !*********
- -LABEL 225 !---<Error>---
- !*********
- IfVar 7 1 229 ! If disconnecting, just return.
- Alert 200 The modem is not responding to the hangup command.\13Turn it off and then on again before retrying.
- SetVar 1 0 ! clear # hangup tries counter
- Jump 220 ! try to hangup again
- !
- !*********
- -LABEL 229 !---<Return from the Hangup sequence>---
- !*********
- Wait 60 ! wait 1 sec
- Flush ! clear input buffer
- Return
- !
- !================================================================================
- -LABEL 230-239 !***<UNUSED>***
- !================================================================================
- !
- !================================================================================
- -LABEL 240 !***<Disconnection Sequence>***
- !================================================================================
- !
- ! If the connection is closed, we cant hangup, so just exit
- ! CTBIFCLOSED <LabelToGotoIfConnectionClosed>
- CTBIFCLOSED 246
- !
- SetVar 7 1 ! We're disconnecting, so set the flag
- ! Look for one of the following expected responses
- MatchStr 1 242 U#
- MatchStr 2 244 NO CARRIER
- Wait 60 ! wait 1 sec
- Jump 244 ! and hang up the phone
- !
- !*********
- -LABEL 242 !---<Sign off the network>---
- !*********
- Xmit BYE\13
- Wait 120 ! wait 2 secs
- !
- !*********
- -LABEL 244 !---<Hang up the phone>---
- !*********
- SetVar 1 0 ! clear the # hangup tries counter
- Jsr 210 ! Execute the Hang-up subroutine
- ! No CTBClose here because the connection is closed externally from the script
- ! in case we exited the script with an error before completion.
- Flush ! clear input buffer
- Exit 0 ! exit the script normally
- !
- !*********
- -LABEL 246 !---<Connection Was Closed>---
- !*********
- Flush ! clear input buffer
- Exit 0 ! exit the script normally
- ###
-